package com.pengpeng.nacos.provider.controller;

import com.pengpeng.nacos.provider.properties.UserProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 彭鹏
 * @date 2021/10/28.
 */
@RestController
public class ProviderController {
    @Value("${nacos.name:lily}")
    private String nacosName;
    @Autowired
    private UserProperties userProperties;
    @GetMapping("/echo")
    public String echo(String name) {
        System.out.println(userProperties);
        return "provider:" + name+",nacos:"+nacosName;
    }
}
